Skip to content

fix(explorer): pass version to operationIdFactory for all versioning types#3783

Merged
kamilmysliwiec merged 1 commit intonestjs:masterfrom
maruthang:fix/operationid-version-all-types-3268
Apr 9, 2026
Merged

fix(explorer): pass version to operationIdFactory for all versioning types#3783
kamilmysliwiec merged 1 commit intonestjs:masterfrom
maruthang:fix/operationid-version-all-types-3268

Conversation

@maruthang
Copy link
Copy Markdown
Contributor

PR Checklist

PR Type

  • Bugfix

What is the current behavior?

The operationIdFactory callback only receives the version parameter when using URI/path versioning. For HEADER, MEDIA_TYPE, and CUSTOM versioning types, the version parameter is always undefined.

Issue Number: #3268

What is the new behavior?

Added getNonPathVersion() method that reads version from the @Version() decorator metadata or falls back to defaultVersion from versioning options for non-URI versioning types. This version is passed to getOperationId when no path-based version is found.

5 regression tests added covering HEADER, MEDIA_TYPE, CUSTOM versioning types and the default operationIdFactory.

Does this PR introduce a breaking change?

  • No

…types

operationIdFactory only received version for URI/path versioning.
For HEADER, MEDIA_TYPE, and CUSTOM versioning, version was always
undefined. Read version from @Version() decorator metadata or
defaultVersion as fallback for non-URI versioning types.

Closes nestjs#3268
@kamilmysliwiec kamilmysliwiec merged commit 454731d into nestjs:master Apr 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants